Linked Server "Could not open a connection to SQL Server [1909]" after reboot
We have two production servers, with RCP [out] enabled linked servers set up back and forth between them. When they are rebooted at the same time one of the linked servers will throw this error:
Named Pipes Provider: Could not open a connection to SQL Server [1909]. 767462021 OLE DB provider "SQLNCLI10" for linked server "server3" returned message "Login timeout expired".
OLE DB provider "SQLNCLI10" for linked server "server3" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and
if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.".
I've been fixing it by dropping and re-creating the linked server. It's completely identical as before (in sp_linkedservers), so I'm thinking this shouldn't be necessary. My guess is it's only happening because during startup the other server was not available.
If this is true, can I force a reset of the linked server, without having to restart the server instance, or recreate the linked server?
May 18th, 2012 12:53pm
Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64) Apr 2 2010 15:48:46 Copyright (c) Microsoft Corporation Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
Free Windows Admin Tool Kit Click here and download it now
May 18th, 2012 1:01pm
You could try to increase the remote login timeout, but that will not be a 100% solution since you could be waiting for the other to reboot for a long time
To see what the current value is then run sp_configure with no paramters and scroll down the list to remote login timeout. The value is probabally 10
To change the timeout you can use this syntax (0 would be indefinite wait)
sp_configure 'remote login timeout', 30
go
reconfigure with override
go
Chuck
May 18th, 2012 1:12pm
Hi Chuck, thanks for the reply. Both servers were already set to 20. I think this might work if in the ensuing 10 seconds the other server happened to come on line. I could also set it to 60, but then production queries would be waiting 60 seconds
for timeout. I'm really after a cause and solution. It's as though the server tries once, sees that the other server is unavailable, and henceforth refuses to try again. I'd like it to try again. Really, it should try every time.
Could it be that upon startup SQL Server looks for all its linked servers and marks ones it can't reach in that moment as forever invalid? I'm sure this doesn't happen after startup, only during.
Free Windows Admin Tool Kit Click here and download it now
May 19th, 2012 12:16pm
Check wherever SQL Server Browser service is set to start automatically.
May 19th, 2012 2:22pm
thanks Rusul, I think that's it!
Free Windows Admin Tool Kit Click here and download it now
May 21st, 2012 10:57am